﻿var status = -1
var questid = [1460, 1461, 1462, 1463, 1464, 1465, 1466, 1478]

function start() {
	action(1, 0, 0)
}

function action(mode, type, selection) {
	if (mode == 0) {
		cm.dispose()
	} else {
		if (mode == 1)
			status++
		else
			status--

		if (status == 0) {
			cm.sendNextN("请选择功能:\r\n\r\n" + (cm.isQuestFinished(1465) ? "" : "#L0#一键五次转职 10000点卷#l\r\n") + "#L1#购买1000个V核心 10余额#l\r\n#L2#打开V核心学习技能UI#l");

		} else if (status == 1) {
			if (selection == 0) {
				if (cm.getPlayer().getCSPoints(1) > 10000 && cm.getLevel() >= 200) {
					cm.gainNX(1, -10000);
                //	cm.show5thJobEffect();
               		cm.forceCompleteQuest(1465);
             		cm.worldMessage("恭喜新玩家"+ cm.getChar().getName() +"在石像处开启五转");
					cm.gainVCraftCore(140);
					cm.sendOk("转职完成，免费获取140个V核心，消耗10000点卷");
                   // cm.addPopupSay(2430000, 8000, "转职完成，免费获取140个V核心，消耗10000点卷");
				} else {
					cm.sendOk("等级不足或者点卷不足！");
				}

			} else if (selection == 1) {
				if (cm.getHyPay(1) > 9) {
					cm.addHyPay(10);
					cm.gainVCraftCore(1000);
					cm.sendOk("购买完成,获得1000个V核心，消耗10余额");
					cm.playerMessage(5, "[余额消费提示] 消耗10余额，剩余余额：" + cm.getHyPay(1))
				} else {
					cm.sendOk("余额不足！");
				}

			} else if (selection == 2) {
				if (cm.isQuestFinished(1465)) {
					cm.openUI(1131);
				} else {
					cm.sendOk("我还无法为你提供服务。！");
				}
			}
			cm.dispose();
		}
	}
}